from django.db import models


class BookModel(models.Model):
    btitle = models.CharField(max_length=200, verbose_name='图书名字')
    price = models.DecimalField(max_digits=7, decimal_places=2, verbose_name='图书价格')
    bread = models.IntegerField(default=0, verbose_name='阅读量')
    bcomment = models.IntegerField(default=0, verbose_name='评论量')
    img = models.ImageField(verbose_name='图书封面图', null=True)

    class Meta:
        db_table = 'tb_book'

    def __str__(self):
        return self.btitle
